<extend name="Index/base"/>
<block name="css">
    <link rel="stylesheet" href="__STATIC__/common/css/highlight.min.css?v=__VERSION__">
</block>
<block name="main">
    <section class="main">
        <div class="cover-top">
            <div class="section panel">
                <div class="cover-info clearfix">
                    <div class="cover-left">
                        <img src="//img.wooo.wang/{$doc.img}" title="{$doc.name}">
                    </div>
                    <div class="cover-right">
                        <h1>{$doc.name}<if condition="$doc['status'] eq -1"><span class="red"> 「冻结中」</span><elseif condition="$doc['status'] eq 1"/><span class="green"> 「隐藏中」</span></if></h1>
                        <p>{$doc.desc}</p>
                        <p class="cover-icon">
                            <span title="收藏数"><i class="icon-star"></i> <b class="focus-count" id="focusCount">{$doc.collect}</b> </span><span title="修改次数"><i class="icon-pencil"></i> {$doc.change} </span><span title="创建时间"><i class="icon-time"></i> {$doc.create|date="Y-m-d",###} </span>
                        </p>
                        <p class="cover-con">
                            <if condition="$canRead">
                                <a href="//doc.wooo.wang/{$doc['id']}" class="btn btn-default">阅读</a>
                            </if>
                            <if condition="$doc['bid']">
                                <a href="//bbs.wooo.wang/{$doc['bid']}" class="btn btn-wirte">社区</a>
                                <else/>
                                <a href="//wooo.wang/u/{$doc['uid']}" class="btn btn-wirte">作者</a>
                            </if>
                            <if condition="$canFocus">
                                <if condition="$collect">
                                    <a href="javascript:void(0)" class="btn btn-ed" id="focusBtn" data-mark="2">取消收藏</a>
                                <else/>
                                    <a href="javascript:void(0)" class="btn btn-default" id="focusBtn" data-mark="1">收藏「$1」</a>
                                </if>
                                <a href="javascript:void(0)" class="btn btn-default" id="donationBtn">捐赠</a>
                            </if>
                            <if condition="$canEdit">
                                <a href="{:U('/e/'.$doc['id'])}" class="btn btn-wirte">编辑</a>
                            </if>
                            <if condition="$super">
                                <a href="{:U('/set/'.$doc['id'])}" class="btn btn-wirte">设置</a>
                            </if>
                            <if condition="$canFocus">
                                <br><span class="collect-remark" id="collectMsg">收藏文档需花费1点贡献度，取消收藏将不返还贡献度！</span>
                            </if>
                            <if condition="$doc['status'] eq -1"><span class="collect-remark red">该文档已被冻结，无法浏览！无法编辑！</span></if>
                        </p>
                    </div>
                    <div class="doc-qr">
                        <img src="//img.wooo.wang/{$doc['qr']}" alt="手机扫码阅读">
                        <p>扫一扫用手机阅读</p>
                    </div>
                </div>
                <ul class="cover-menu clearfix">
                    <li><a href="javascript:void(0)" id="aboutBtn" class="active"><span class="icon-about"></span> ABOUT</a></li>
                    <li><a href="javascript:void(0)" id="cateBtn"><span class="icon-sum"></span> 目录</a></li>
                    <li class="right">
                        <a href="javascript:void(0);" class="right" id="shareQQ" title="分享到QQ空间" target="_blank"><span class="icon-qq"></span></a>
                        <a href="javascript:void(0);" class="right" id="shareWeibo" title="分享到微博" target="_blank"><span class="icon-weibo"></span></a>
                        <a href="javascript:void(0);" class="right" id="shareWeixin" title="分享到微信" target="_blank"><span class="icon-weixin"></span></a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="section">
            <div class="cover-container panel">
                <div class="cover-content" id="aboutZone">
                    <if condition="$article">
                        <div class="cover-article wooo">
                            {$article.html}
                        </div>
                        <div class="cover-time">
                            <span>更新于 {$article.create|date="Y-m-d H:i:s",###}</span>
                        </div>
                    <else />
                        <div class="cover-article">
                            <p class="no-msg">文档暂未书写「前言」</p>
                        </div>
                    </if>
                </div>
                <div class="cate-content hide" id="cateZone">
                    <div class="cover-article" id="cateDiv">
                        <p class="no-msg" id="cateMsg">正在获取文档目录，请稍后...</p>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <if condition="UID">
        <div class="modal hide" id="modal">
            <div class="modal-container" style="max-width:400px;margin-top:20%;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button class="modal-close" id="modalClose"><span>&times;</span></button>
                        <h4 class="modal-title">捐赠贡献度</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form">
                            <div class="form-item">
                                <input type="number" name="gx" id="gxInput" data-gx="{$user.gx}" min="1" max="{$user.gx}" placeholder="请填写您捐赠的贡献度额度...">
                            </div>
                        </div>
                        <p class="edit-tip">您当前拥有 <strong class="red" id="userAllGx">{$user.gx}</strong> 点贡献度...</p>
                    </div>
                    <div class="modal-footer">
                        <button class="modal-no" id="modalNo">取消</button>
                        <button class="modal-save no-save" id="modalOk" data-url="/doc/donation/did/{$doc['id']}">确认</button>
                    </div>
                </div>
            </div>
        </div>
    </if>
</block>
<block name="js">
    <script src="__STATIC__/common/js/highlight.min.js?v=__VERSION__"></script>
    <script>
        var did = {$doc.id}, docName = "{$doc.name}", docDesc = "{$doc.desc}", collects = {$doc.collect}, cate = {$cate.content|default="[]"};
    </script>
    <script src="__STATIC__/doc/js/donation.js?v=__VERSION__"></script>
    <script src="__STATIC__/doc/js/doc.js?v=__VERSION__"></script>
</block>